<template>
        <div style="display: flex;justify-content: space-around;width:100%;">
    <router-link :to="{name: 'findDoctor'}" class="docterRoom one-area" v-if='usertype!="doctor"&&usertype!="clinic"'>
      <div class="img-box">
        <img src="../../image/icon_share_clinic@2x_03.png" />
      </div>
      <span>预约医生</span>
    </router-link>
    <router-link :to="{name: 'findClinic',query: {user: 'patient'}}" class="docterRoom one-area" v-if='usertype!="doctor"&&usertype!="clinic"'>
      <div class="img-box">
        <img src="../../image/icon_share_clinic@2x_03.png" />
      </div>
      <span>查找门诊</span>
    </router-link>
    <router-link :to="{name: 'customOrder'}" class="docterRoom one-area" v-if='usertype!="doctor"&&usertype!="clinic"'>
      <div class="img-box">
        <img src="../../image/icon_studio_backstage.png" />
      </div>
      <span>我的订单</span>
    </router-link>
    <router-link :to="{name: 'advisory'}" class="docterRoom one-area" v-if='usertype!="doctor"&&usertype!="clinic"'>
      <div class="img-box">
        <img src="../../image/icon_share_clinic@2x_03.png" />
      </div>
      <span>在线咨询</span>
    </router-link>
  </div>

</template>
<script>
  export default {
    data() {
      return {
        type: '',
        list: [],
        userid: '',
        usertype: '',
      }
    },
    computed: {
      // 登录拦截
      isLogin() {
        this.userid = localStorage.getItem("loginMobile");
        if (!this.userid) {
          return false;
        } else {
          return true;
        }
      },
    },
    methods: {
      //专家会诊
      goDocConsultation() {
        if (this.usertype == "doctor") {
          this.$router.push({
            name: 'docConsultation'
          });
        } else {
          this.$router.push({
            name: 'authentication'
          });
        }
      },
      justUserType() { //判断用户是否通过医生认证
        if (localStorage.getItem("loginMobile")) {
          this.userid = localStorage.getItem("loginMobile");
          this.$api.get(this.$api.baseURLSchool, "select_cid/user/" + this.userid, {}, r => {
            localStorage.setItem("type_sub", JSON.stringify(r.data.info.type_sub));
            if (r.data.info.type == 'clinic') {
              this.type = 'ImClinic'
            } else if (r.data.info.type == 'doctor') {
              this.type = 'ImDoctor'
            }
            if (r.data.ret == 1) {
              if (r.data.info.type) {
                this.usertype = r.data.info.type;
              }
            }
          }, err => {
            console.log(err);
          })
        }
      },

    },
    created() {
      this.justUserType();;
    },
    activated() {

    },
  }

</script>

<style lang="scss" scoped>
  @import "../../css/swiper.min.css";
  @import "../../css/scss/home/home.css";

  .zhibo {
    left: 100%;
    width: 100%;
    /* height: 100%; */
    /* background: red; */
    position: absolute;
    top: 0.4rem;
    z-index: 50;
    /* animation: danmu 50s linear 0s 1; */
    animation: danmu 20s linear infinite;

  }

  @keyframes danmu {
    from {
      left: 100%;
      transform: translateX(0);
    }
    to {
      left: 0;
      transform: translateX(-100%);
    }
  }

  .zhibo ul li {
    width: 100px;
    height: 20px;
    line-height: 20px;
    border-radius: 5px;
    background: #fff;
    padding-left: 5px;
    margin: 5px;
    float: left;
    text-align: center;
  }

  .mc {
    padding: 40px 0;
    img {
      display: block;
      margin: 0 auto;
    }
    p {
      padding-top: 10px;
      text-align: center;
    }
  }

  s {
    margin-left: 8px;
    font-size: .12rem;
    color: rgba(156, 156, 156, 1);
  }

</style>
